#!/bin/bash

SCRIPT=`realpath $0`
SCRIPTPATH=`pwd -P`
FILES=$SCRIPTPATH/assets/*

for f in $FILES
do
  if [[ "$f" == *\.coffee* ]]
  then
    echo "Complie: " $f
    coffee -c $f
  fi
done

for f in $FILES
do
  if [[ "$f" == *\.js* ]]
  then
    echo "Copy: " $f "to ${SCRIPTPATH}/static/assets/${basename}"

    cp $f "${SCRIPTPATH}/static/assets/${basename}"
  fi
done

for f in $FILES
do
  if [[ "$f" == *\.scss* ]]
  then
    echo "Compile: " $f

    filename=$(basename "$f")

    sass $f "${SCRIPTPATH}/static/assets/${filename%.*}.css"
  fi
done

rm -rf .sass-cache

